package com.example.zlw.dem18;

/**
 * @program: Zlw
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-11-08 20:08
 **/
public class PigFactory {
    public  PigFarm createPigFarm(String name) {
        if (name.equals("五花肉")) {
            return new Pig();
        } else if (name.equals("黑豬佩奇")) {
            return new HeiPig();
        } else {
            return null;
        }
    }
    }
